@extends('backend/layouts/default')
@section('title')
<?= !empty($data['category']->id) ? "Sửa chuyên mục" : "Tạo chuyên mục" ?> :: Tin tức
@stop
@section('content')
<h3>
    <span
        class="glyphicon glyphicon-pencil"></span> <?= !empty($data['category']->id) ? "Sửa chuyên mục" : "Tạo chuyên mục" ?>
</h3>
<form role="form" action="{{ route('create/category/news') }}" method="post" accept-charset="utf-8" class="form-horizontal">
    {{ Form::token() }}
    <input type="hidden" name="data[Category][id]" value="{{ $data['category']->id }}"/>

    <div class="row">
        <div class="col-md-9">
            <div class="form-group <?= $errors->has('title') ? 'error' : '' ?>">
                <label class="control-label col-sm-4">Tiêu đề</label>

                <div class="col-sm-8">
                    <input type="text" name="data[Category][title]" class="form-control" value="{{ $data['category']->title }}"/>
                    <?= $errors->first('title', '<span class="help-inline">:message</span>') ?>
                </div>
            </div>
            <div class="form-group">
                <label class="control-label col-sm-4">Trạng thái</label>
                <div class="col-sm-8">
                    {{ Form::select('data[Category][status]',array('on'=>'Hiển thị','off'=>'Không hiển thị'), Input::old('data[Category][status]',$data['category']->status),array('class'=>'form-control')) }}
                </div>
            </div>
            <div class="control-group" align="right">
                <div class="controls">
                    <a class="btn btn-link" href="{{ route('category/news') }}">Hủy</a>
                    <button type="submit" class="btn btn-success">Lưu</button>
                </div>
            </div>
        </div>
    </div>
</form>
@stop